//
//  ZButton.h
//
//  Created by ZhàoYǒng on 31/10/2017.
//  Copyright © 2017 ZhàoYǒng. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, ZButtonImagePosition) {
    ZButtonImagePositionNone,
    ZButtonImagePositionLeft,
    ZButtonImagePositionRight,
    ZButtonImagePositionTop,
    ZButtonImagePositionBottom
};

@interface ZButton : UIControl

/// Attributes
@property (nonatomic, copy) NSString *attributes;

/// Init with image position.
- (instancetype)initWithImagePosition:(ZButtonImagePosition)position;
/// Margin between image and text. Default 5.f. It must be set after initialization.
- (void)setMargin:(CGFloat)margin;
/// Tint color of image in template model.
- (void)setImageTintColor:(UIColor *)tintColor;
/// Set image and title.
- (void)setTitle:(NSString *)title          state:(UIControlState)state;
/// Set UIControlStateNormal color will set UIControlStateHighlighted at the same time.
- (void)setTitleColor:(UIColor *)color      state:(UIControlState)state;
- (void)setFont:(UIFont *)font              state:(UIControlState)state;
- (void)setImage:(UIImage *)image           state:(UIControlState)state;
- (void)setBackgroundImage:(UIImage *)image state:(UIControlState)state;
/// Set badge
- (void)setBadge:(NSUInteger)badge;

/// Get image and title.
- (NSString *)titleForState:(UIControlState)state;
- (UIImage *)imageForState:(UIControlState)state;
- (UIImage *)backgroundImageForState:(UIControlState)state;

@end
